package com.duyutian.zhanglong.p33JavaNio体系;

import java.nio.IntBuffer;
import java.security.SecureRandom;

public class NioTest1 {
    public static void main(String[] args) {
        IntBuffer bf = IntBuffer.allocate(10);

        for (int i = 0; i < bf.capacity(); i++) {
            int ran = new SecureRandom().nextInt(20);
            bf.put(ran);
        }

        bf.flip();

        while (bf.hasRemaining()) {
            System.out.println(bf.get());
        }
    }
}
